package com.example.designmode.command


/**
 * 服务员
 *
 * @author zhouronghua
 * @time 2022/3/9 2:22 下午
 */
class Waiter {
    var commands = ArrayList<Command>()

    fun addCommand(command: Command) {
        commands.add(command)
    }

    fun orderUp() {
        println("美女服务员：大厨，新订单来了....")
        for (command in commands) {
            command?.let {
                // 执行命令
                command.execute()
            }
        }
    }
}